#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

string op[8] = {"YES", "YEs", "YeS", "Yes", "yES", "yEs", "yeS", "yes"};

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    int n;
    cin >> n;
    string s;

    while(n --){
        cin >> s;
        bool flag = false;

        for (int i = 0; i < 8; i ++){
            if(op[i] == s){
                flag = true;
            }
        }

        if(flag){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }

    return 0;
}
